package com.example.controller;

import com.example.Repository.CollectRepository;
import com.example.pojo.Result;
import com.example.pojo.dto.LikeDto;
import com.example.pojo.vo.TrendsVo;
import jakarta.annotation.Resource;
import jakarta.validation.Valid;
import org.springframework.web.bind.annotation.*;

import java.util.List;


/**
 * @author crt
 */
@RestController
@RequestMapping("collect")
public class CollectController {

    @Resource
    CollectRepository collectRepository;

    @PostMapping("/trendsCollect")
    public Result<String> trendsCollect(@Valid @RequestBody LikeDto likeDto){

        return collectRepository.trendsCollect(likeDto);
    }

    @PostMapping("/collectList")
    public Result<List<TrendsVo>> collectList(@RequestParam Integer userId){
        return collectRepository.collectList(userId);
    }


}
